Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the formatted error from log_and_500, so the CLI can report it #338

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Sep 28, 2023

Description of Changes

In the client API's log_and_500, return an ErrorResponse with a body derived from the error, rather than a bare 500 code.

Note that this exposes previously-internal error messages to users.

The error messages newly reported by the CLI are not beautiful, but they at least describe the failure. Also, this PR does not improve the status codes returned; errors in e.g. /database/publish always return 500 (INTERNAL_SERVER_ERROR), where they should often report more-specific errors, some of which put the client at fault rather than the server. Still, it's an improvement.

Attempting to publish to a name you don't own:

Error: Permission denied: `974ab31b518f46d0b59b0afee78abdf2dbf4df6e60a332dce9c373ab8bebcea6` does not own database `5ebd1221afb10aaf`

Attempting to publish a database with incompatible schema changes without -c:

Error: Database update rejected: incompatible schema changes for: ["Connected", "Disconnected"]

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

Note that this exposes previously-internal error messages to users.
@gefjon gefjon requested a review from jdetter September 28, 2023 20:35
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, working, thank you Phoebe! 👍

@gefjon gefjon enabled auto-merge (squash) September 28, 2023 21:06
@gefjon gefjon merged commit 0a3a9d6 into master Sep 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants